package com.qkjia.nacosconfigclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//创建ConfigClientController，从Nacos配置中心中获取配置信息
@RestController//controller + @ResponseBody注解。
@RefreshScope//动态刷新配置文件
public class ConfigClientController {

    @Value("${config.info}")//配置中心的填写
    private String configInfo;

    @GetMapping("/configInfo")
    public Object getConfigInfo() {
        return configInfo;
    }
}
